package cn.kgc.bilibili.service.impl;

import cn.kgc.bilibili.dao.UserMapper;
import cn.kgc.bilibili.pojo.User;
import cn.kgc.bilibili.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService{
    @Resource
    private UserMapper userMapper;

    public UserMapper getUserMapper() {
        return userMapper;
    }

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public int register(User user) {
        return userMapper.register(user);
    }

    @Override
    public User login(String phone) {
        return userMapper.login(phone);
    }

    @Override
    public int updateUserInfo(User user) {
        return userMapper.updateUserInfo(user);
    }

    @Override
    public int userexp(int id, int exp) {
        return userMapper.userexp(id,exp);
    }

    @Override
    public User getUser(int id) {
        return userMapper.getUser(id);
    }

    @Override
    public int UserHeadPhoto(int id, String imgUrl) {
        return userMapper.UserHeadPhoto(id,imgUrl);
    }

    @Override
    public int updatePassword(String password,Integer id) {
        return userMapper.updatePassword(password,id);
    }

    @Override
    public int updatePhone(String phone,Integer id) {
        return userMapper.updatePhone(phone,id);
    }

    @Override
    public User registerPassword(String phone) {
        return userMapper.registerPassword(phone);
    }
}
